package com.cpit.platform.security;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import com.cpit.platform.log.LogOperator;
import com.cpit.platform.web.controller.MessageEndPoint;

@WebListener  
public class SessionHolderListener implements HttpSessionListener{  
	private static final String loggerName = SessionHolderListener.class.getName();

	public void sessionCreated(HttpSessionEvent arg0) {
		LogOperator.info(loggerName,"session sessionCreated " + arg0.getSession().getId());
	}  


	public void sessionDestroyed(HttpSessionEvent arg0) { 
		LogOperator.info(loggerName,"session sessionDestroyed " + arg0.getSession().getId());
		MessageEndPoint.sendMsgTo("contextDestroyed", arg0.getSession().getId());
	}  
}  
